#!/usr/bin/env python

import sys
import cloud
import xmlrpclib

if __name__ == "__main__":
    argc = len(sys.argv)
    if argc < 2:
        sys.exit(0)
    else:
        XMLRPC = "http://192.168.100.101:20060"
        server = xmlrpclib.ServerProxy(XMLRPC)
        ret = cloud.get_vm_info(["crane", "cranepass"], sys.argv[1])
        if ret[0]:
            result = server.on_vm_create(ret[1]["id"], ret[1]["ip"])
